#include <bits/stdc++.h>
using namespace std;
/**
 * @brief Naive prime test. Accurate but slow.
 *
 * @param x
 * @return true
 * @return false
 */
bool factor(long long x) {
  if (x < 2) {
    return false;
  }
  for (long long i = 2; i * i < x; ++i) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  const bool test = false;
  if constexpr (test) {
    cout << factor(1) << endl;
    cout << factor(42) << endl;
    cout << factor(2147483647) << endl;      // 10-digit prime
    cout << factor(136117223861LL) << endl;  // == 104729*1299709
    cout << factor(234 * 987) << endl;
    // expect: 0 0 1 0 0
    // test passed.
  } else {
    long long n;
    cout << boolalpha;
    while (cin >> n) {
      cout << factor(n) << endl;
    }
  }
}
